/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2019.
 * Description: rtos_mce_trap.h
 * Author: xiaojiangfeng
 * Create: 2019-06-03
 */

#ifndef __RTOS_MCE_TRAP_H
#define __RTOS_MCE_TRAP_H

#include <linux/types.h>
#include <asm/ptrace.h>

#ifdef CONFIG_RTOS_MCE_TRAP
int register_mce_trap_hook(int (*hook)(struct pt_regs *, int));
void unregister_mce_trap_hook(void);
int call_rtos_mce_hook(struct pt_regs *regs, int recover);
#else
static inline int register_mce_trap_hook(int (*hook)(struct pt_regs *, int))
{
	return -ENOENT;
}

static inline void unregister_mce_trap_hook(void)
{
}

static inline int call_rtos_mce_hook(struct pt_regs *regs, int recover)
{
	return 0;
}
#endif /* CONFIG_RTOS_MCE_TRAP */

#endif /* __RTOS_MCE_TRAP_H */

